<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Person</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

<!--        <fieldset class="table-search-fieldset">-->
<!--            <legend>搜索信息</legend>-->
<!--            <div style="margin: 10px 10px 10px 10px">-->
<!--                <form class="layui-form layui-form-pane" action="">-->
<!--                    <div class="layui-form-item">-->
<!--                        <div class="layui-inline">-->
<!--                            <label class="layui-form-label">编号</label>-->
<!--                            <div class="layui-input-inline">-->
<!--                                <input type="text" name="pid" autocomplete="off" class="layui-input">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <label class="layui-form-label">姓名</label>-->
<!--                            <div class="layui-input-inline">-->
<!--                                <input type="text" name="name" autocomplete="off" class="layui-input">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <label class="layui-form-label">密码</label>-->
<!--                            <div class="layui-input-inline">-->
<!--                                <input type="text" name="pass" autocomplete="off" class="layui-input">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <label class="layui-form-label">邮箱</label>-->
<!--                            <div class="layui-input-inline">-->
<!--                                <input type="email" name="mile" autocomplete="off" class="layui-input">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <label class="layui-form-label">电话</label>-->
<!--                            <div class="layui-input-inline">-->
<!--                                <input type="text" name="tel" autocomplete="off" class="layui-input">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <button type="submit" class="layui-btn layui-btn-primary" lay-submit-->
<!--                                    lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索-->
<!--                            </button>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </form>-->
<!--            </div>-->
<!--        </fieldset>-->

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

    </div>
</div>
<!--<script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>-->
<script src="layui/layui.js" charset="utf-8"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            layuimini = layui.layuimini;

        table.render({
            elem: '#currentTableId',
            url: '/Person/Persons',
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],

            cols: [[
                {type: "checkbox", width: 50, fixed: "left"},
                {field: 'pid', width: 150, title: '编号', sort: true},
                {field: 'name', width:150, title: '姓名', sort: true},
                {field: 'pass', width:150, title: '密码'},
                {field: 'mile', width: 150, title: '邮箱'},
                {field: 'tel', width: 150, title: '电话'},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            var result = JSON.stringify(data.field);
            layer.alert(result, {
                title: '最终的搜索信息'
            });

            //执行搜索重载
            table.reload('currentTableId', {
                page: {
                    curr: 1
                }
                , where: {
                    searchParams: result
                }
            }, 'data');

            return false;
        });
    });
</script>
<script>

</script>

</body>
</html>